package com.veer.shop.config;

/**
 * 
 * 接口返回码及消息枚举类
 * 
 * @author WangBin
 * 2020年8月12日-下午4:14:26
 */
public enum ResponseCodeEnum {
	/*------------------------------通用错误码-------------------------------------*/
	SUCCESS(200, "业务处理成功！"),
	ERROR(-1, "业务处理失败！"),
	PARAMS_VALID_ERROR(1001, "参数校验错误"),
	GET_ENTITY_NOT_FOUND(1002, "访问的对象不存在！"),
	/*------------------------------权限token错误码-------------------------------------*/
	NO_TOKEN_ERROR(403, "无权限访问该资源！"),
	VALID_TOKEN_ERROR(401, "token 校验失败，请重新获取token！"),
	GET_AUTH_TOKEN_PARAMS_ERROR(2001, "获取Token的用户名或密码不可为空！"),
	GET_AUTH_TOKEN_ERROR(2002, "用户账户或者密码错误！"),
	/*------------------------------管理员错误码-------------------------------------*/
	ADMIN_USER_CREATE_ERROR(34001, "新增管理员失败！"),
	/*------------------------------商品错误码-------------------------------------*/
	VERIFY_PRODUCT_BRAND_ERROR(4001, "校验品牌参数失败！"),
	VIEW_PRODUCT_BRAND_ERROR(4002, "品牌信息不存在！"),
	VIEW_ATTRIBUTE_SET_ERROR(4003, "属性集信息不存在！");
	
	private int code;
	private String message;
	
	ResponseCodeEnum(int code, String message) {
		// TODO Auto-generated constructor stub
		this.code = code;
		this.message = message;
	}
	
	public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
    
    @Override
    public String toString() {
        return "ErrorCodeEnum{" + "code='" + this.code + '\'' + ", message='" + this.message + '\'' + '}';
    }
}
